import request from '../shared/components/request';

export const fetchRoleData = query => {
    return request({
        url: 'http://172.17.174.180:8080/role/selectRolePermission.do',
        method: 'get',
        data: query,
        headers:{
            'token':localStorage['ms_token']
        }
    });
};

export const fetchRolePData = query => {
    return request({
        url: 'http://172.17.174.180:8080/rolePermission/findAll.do',
        method: 'get',
        data: query,
        headers:{
            'token':localStorage['ms_token']
        }
    });
};

export const ModifyRoleData = (query) => {
    return request({
        url: 'http://172.17.174.180:8080/rolePermission/updateByrIdAndpId.do',
        method: 'post',
        data: query,
        emulateJSON: true,
        headers:{
            'token':localStorage['ms_token']
        }
    });
};

export const AddRoleData = (query) => {
    return request({
        url: 'http://172.17.174.180:8080/role/insert.do',
        method: 'post',
        data: query,
        emulateJSON: true,
        headers:{
            'token':localStorage['ms_token']
        }
    });
};

export const DelRoleData = (query) => {
    return request({
        //url:'/api/role/deleteByPrimaryKey.do',
        url: 'http://172.17.174.180:8080/role/deleteByPrimaryKey.do',
        method: 'post',
        data: query,
        emulateJSON: true,
        headers:{
            'token':localStorage['ms_token']
        }
    });
};